package com.ruoyi.mdm.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mdm.mapper.SkuMasterSubMapper;
import com.ruoyi.mdm.domain.SkuMasterSub;
import com.ruoyi.mdm.service.ISkuMasterSubService;

/**
 * sku子Service业务层处理
 *
 * @author shiseido
 * @date 2025-03-01
 */
@Service
public class SkuMasterSubServiceImpl implements ISkuMasterSubService {
    @Autowired
    private SkuMasterSubMapper skuMasterSubMapper;

    /**
     * 查询sku子
     *
     * @param id sku子主键
     * @return sku子
     */
    @Override
    public SkuMasterSub selectSkuMasterSubById(Long id) {
        return skuMasterSubMapper.selectSkuMasterSubById(id);
    }

    /**
     * 查询sku子列表
     *
     * @param skuMasterSub sku子
     * @return sku子
     */
    @Override
    public List<SkuMasterSub> selectSkuMasterSubList(SkuMasterSub skuMasterSub) {
        return skuMasterSubMapper.selectSkuMasterSubList(skuMasterSub);
    }

    /**
     * 新增sku子
     *
     * @param skuMasterSub sku子
     * @return 结果
     */
    @Override
    public int insertSkuMasterSub(SkuMasterSub skuMasterSub) {
        skuMasterSub.setCreateTime(DateUtils.getNowDate());
        return skuMasterSubMapper.insertSkuMasterSub(skuMasterSub);
    }

    /**
     * 修改sku子
     *
     * @param skuMasterSub sku子
     * @return 结果
     */
    @Override
    public int updateSkuMasterSub(SkuMasterSub skuMasterSub) {
        skuMasterSub.setUpdateTime(DateUtils.getNowDate());
        return skuMasterSubMapper.updateSkuMasterSub(skuMasterSub);
    }

    /**
     * 批量删除sku子
     *
     * @param ids 需要删除的sku子主键
     * @return 结果
     */
    @Override
    public int deleteSkuMasterSubByIds(Long[] ids) {
        return skuMasterSubMapper.deleteSkuMasterSubByIds(ids);
    }

    /**
     * 删除sku子信息
     *
     * @param id sku子主键
     * @return 结果
     */
    @Override
    public int deleteSkuMasterSubById(Long id) {
        return skuMasterSubMapper.deleteSkuMasterSubById(id);
    }
}
